package cn.seqdata.jpa.lookup;

public abstract class LookupKeyval<ID> implements Comparable<LookupKeyval<ID>> {
	protected ID id;
	private String name;
	private Integer orderNo;

	public LookupKeyval() {
	}

	public LookupKeyval(ID id, String name) {
		this.id = id;
		this.name = name;
	}

	public abstract ID getId();

	public void setId(ID id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(Integer orderNo) {
		this.orderNo = orderNo;
	}

	@Override
	public String toString() {
		return "[id=" + id + ", name=" + name + "]";
	}

	@Override
	public int compareTo(LookupKeyval<ID> o) {
		return LookupKeyvalComparator.instance.compare(this, o);
	}
}
